<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://localhost/juanpi/Static/Home/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="http://localhost/juanpi/Static/Home/js/js.js"></script>
<link rel="stylesheet" href="http://localhost/juanpi/Static/Home/css/shop.css" />
<script type="text/javascript">
	$(function(){
		//商品数量
		$('.add').click(function(){
			var num = parseInt($(this).siblings('.num').val());
			num=num+1;
			$(this).siblings('.num').val(num);
			var sid = $(this).parents('tr').find('.sid').attr('sid');
			var total = $(this).parents('tr').find('.price');
			$.ajax({
				type:"post",
				url:"<?php echo U('AddDel');?>",
				data:{num:num,sid:sid},
				dataType:'json',
				success:function(phpData){
					total.html(phpData.total);
					$('.allnum').html('共（'+phpData.goodsNum+'）件商品');
					$('.allPrice').html(phpData.TotalPrice);
				}
			});
		})
		$('.del').click(function(){
			var num = parseInt($(this).siblings('.num').val());
			if(num==1){
				return false;
			}
			num=num-1;
			$(this).siblings('.num').val(num);
			var sid = $(this).parents('tr').find('.sid').attr('sid');
			var total = $(this).parents('tr').find('.price');
			$.ajax({
				type:"post",
				url:"<?php echo U('AddDel');?>",
				data:{num:num,sid:sid},
				dataType:'json',
				success:function(phpData){
					total.html(phpData.total);
					$('.allnum').html('共（'+phpData.goodsNum+'）件商品');
					$('.allPrice').html(phpData.TotalPrice);
				}
			});
		})
	})
</script>
<title>购物袋-卷皮网</title>
</head>

<body>
<!-- 顶部开始 -->
<div id="toolbar">
	<!-- ****************折扣************** -->
	<div class="tool_l">
		<a href="">卷皮折扣</a>
	</div>
	<!-- ****************折扣************** -->
	<!-- ****************登录/注册************** -->
	<div class="tool_r">
		    <?php if(isset($_SESSION['uid'])){ ?>
			<a href="<?php echo U('Member/index');?>"><?php echo $_SESSION['uname'];?></a><a href="<?php echo U('Index/out');?>">退出</a>
		<?php }else{ ?>
			<a href="<?php echo U('Login/index');?>">登录</a>
			<a href="<?php echo U('Register/index');?>">免费注册</a><span>|</span>
		<?php } ?>	
		<a href="<?php echo U('OrdCen/index');?>">我的订单</a>
		<a class="gouwu" href="<?php echo U('Shop/index');?>">
			<span class="gouwudai"></span>购物袋
			<span class="gouwuqiu">
				    <?php if($_SESSION['cart']){ ?>
				<?php echo $hd['session']['cart']['total_rows'];?>
				<?php }else{ ?>0<?php } ?>
			</span>
		</a><span>|</span>
		<a href="">联系客服</a>
	</div>
	<!-- ****************登录/注册************** -->
</div>
<!-- 顶部结束 -->


<!-- 头部开始 -->
<div id="header">
	<div id="top">
		<div class="logo">
			<a href="http://localhost/juanpi/index.php"></a>
		</div>
		<div class="center">
			<div class="load"></div>
			<span class="new">购物袋 </span>
			<span>确认订单</span>
			<span>支付</span>
			<span>完成</span>
		</div>
	</div>
</div>
<!-- logo结束 -->

<div id="hrt"></div>

<!-- 购物包开始 -->
    <?php if($Gdata['total_rows']){ ?>
<div id="shoplist">
	<div class="top">请在<span>13分45秒</span>内提交订单，下单后您会另有30分钟的支付时间</div>
	<div class="title">
		<ul>
			<li class="li1 allnum">共（<?php echo $Gdata['total_rows'];?>）件商品</li>
			<li class="li2">单价</li>
			<li class="li3">数量</li>
			<li class="li4">小计</li>
			<li class="li5">操作</li>
		</ul>
	</div>
	<table>
		<?php foreach ($Gdata['goods'] as $k=>$v){?>
			<tr>
				<td class="li1">
					<a href=""><img src="http://localhost/juanpi/<?php echo $v['options']['img'];?>" alt="" /></a>
					<a href="" sid="<?php echo $k;?>" class="sid"><?php echo $v['name'];?> <?php echo $v['options']['specName'];?></a>
				</td>
				<td class="li2"><?php echo $v['price'];?><br />
					<span><b>￥</b><?php echo $v['options']['marketprice'];?></span>
				</td>
				<td class="li3">
					<span class="del">-</span>
					<input type="text" value="<?php echo $v['num'];?>" class="num"/>
					<span class="add">+</span>
				</td>
				<td class="li4 price"><?php echo $v['total'];?></td>
				<td class="li5">
					<a href="<?php echo U('delGoods',array('sid'=>$k));?>"></a>
				</td>
			</tr>
		<?php }?>
	</table>
	<div class="coup">
		<!--<a href="">使用购物券&nbsp;>></a>-->
	</div>
	<div class="buttom">
		<div class="bl"></div>
		<div class="br"></div>
		<a class="back" href="http://localhost/juanpi/index.php"><<继续购物</a>
		活动优惠-¥0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;优惠券抵扣-¥0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总计（不含运费）<i>￥</i><span class="allPrice"><?php echo $Gdata['total'];?></span>
		<a class="ok" href="<?php echo U('Order/index');?>">去结算</a>
	</div>
</div>
<!-- 购物包结束 -->
<?php }else{ ?>
	<div id="shop">
		购物袋还是空荡荡哒~快去抢购宝贝吧！<br />
		<a href="http://localhost/juanpi/index.php">去抢购</a>
	</div>
<?php } ?>

<!--黑线-->
<div id="black_len">
	<div class="font">HOT热门特卖</div>
</div>
<!-- 商品列表开始 -->
<div id="goodsList">
	<ul>
		        <?php
        //初始化
        $hd['list']['v'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($todayData)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($todayData as $v) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=4)break;
                //第几个值
                $hd['list'][v]['index']++;
                //第1个值
                $hd['list'][v]['first']=($listId == 0);
                //最后一个值
                $hd['list'][v]['last']= (count($todayData)-1 <= $listId);
                //总数
                $hd['list'][v]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
		<li class="shoplist">
			<div class="new"></div>
			<a href="<?php echo U('Content/index',array('gid'=>$v['gid']));?>">
				<img width=285 height=285 src="http://localhost/juanpi/<?php echo $v['img'];?>" alt="" />
			</a>
			<div class="title">[包邮]
				<a href="<?php echo U('Content/index',array('gid'=>$v['gid']));?>"><?php echo mb_substr($v['gname'],0,20,'utf-8');?>...</a>
			</div>
			<div class="money">
				<span class="rmb">￥</span><b><?php echo $v['shopprice'];?></b>
				<span class="old thr">￥<?php echo $v['marketprice'];?></span>
				<span class="old">(4.0折)</span>
				<a href="<?php echo U('Content/index',array('gid'=>$v['gid']));?>" class="shop">加入购物车</a>
			</div>
		</li>
		<?php }}?>
	</ul>
</div>
<!-- 商品列表结束 -->

<div id="hr"></div>

<!-- 底部开始 -->
<div id="bottom">
	<div class="bo_l">
		<img src="http://localhost/juanpi/Static/Home/images/jp-app-90.png" alt="" /><br />
		扫描二维码下载
	</div>
	<div class="bo_c">
		<ul>
     		<p>获取更新</p>
			<li>●&nbsp;<a href="">iPhone/Android</a></li>
			<li>●&nbsp;<a href="">卷皮QQ空间</a></li>
			<li>●&nbsp;<a href="">卷皮新浪微博</a></li>
			<li>●&nbsp;<a href="">开放API</a></li>
		</ul>
		<ul>
     		<p>商务合作</p>
			<li>●&nbsp;<a href="">卖家免费报名</a></li>
			<li>●&nbsp;<a href="">商务合作</a></li>
			<li>●&nbsp;<a href="">廉政邮箱</a></li>
			<li>●&nbsp;<a href="">lianzheng@juanpi.com</a></li>
		</ul>
		<ul>
     		<p>公司信息</p>
			<li>●&nbsp;<a href="">关于卷皮</a></li>
			<li>●&nbsp;<a href="">媒体报道</a></li>
			<li>●&nbsp;<a href="">诚聘英才</a></li>
			<li>●&nbsp;<a href="">校园大使招募</a></li>
		</ul>
		<ul>
     		<p>帮助中心</p>
			<li>●&nbsp;<a href="">新手上路</a></li>
			<li>●&nbsp;<a href="">积分攻略</a></li>
			<li>●&nbsp;<a href="">网站地图</a></li>
		</ul>
	</div>
	<div class="bo_r">
		<a href=""></a>
		<span>周一至周日<br />9:00-22:00</span>
	</div>
</div>
<!-- 友情链接 -->
<div id="flink">
	 友情链接：
    <a href="">国画</a>
    <a href="">齐家装修</a>
    <a href="">大朴网</a>
    <a href="">世界名表</a>
    <a href="">葡萄酒</a>
    <a href="">易登网</a>
    <a href="">普洱茶</a>
    <a href="">中关村商城</a>
    <a href="">品牌鞋</a>
    <a href="">乐蜂网优惠券</a>
    <a href="">精选折扣</a>
    <a href="">拍鞋网官网</a>
	<a class="more" href="">更多>></a>
</div>


<div id="copy">
	武汉奇米网络科技有限公司 鄂ICP备10209250号　　Copyright © 2010 -2015 JuanPi.com All Rights Reserved
</div>

<div id="safe">
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/r_315online.gif" alt="" /></a>
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/r_cnnic.gif" alt="" /></a>
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/r_gongshang.gif" alt="" /></a>
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/sm_124x47.png" alt="" /></a>
</div>
<!-- 底部结束 -->
</body>
</html>
